package message.types.stalker;

import java.io.IOException;

import network.e2e.FrameReader;
import stalker.Stalker;
import message.visitor.MessageVisitor;

public class LogOffNotification extends StalkerMessage {

  /**
   * Creates a new log off notification for the corresponding id
   */
  public LogOffNotification(Stalker client, Stalker destination, Stalker credential) {
    super(client, destination, credential);
  }
  
  /**
   * Retrieves this message over the net
   * @throws IOException 
   */
  public LogOffNotification(Stalker client, Stalker destination, FrameReader reader) throws IOException {
    super(client, destination, reader);
  }
  
  @Override
  public <T> T accept(MessageVisitor<T> visitor) {
    return visitor.visit(this);
  }

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof LogOffNotification)) {
      return false;
    }
    return super.contentEquals(obj);
  }

  @Override
  public String toString() {
    return "LogOffNotification for " + this.getCredential();
  }

}
